package com.jsu.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.jsu.bean.FMatchLId;
import com.jsu.bean.LostId;
import com.jsu.dao.FoundMessageMapper;
import com.jsu.dao.LostMessageMapper;
import com.jsu.service.FoundMatchToLost;

@Component
public class FMatchLTask {

	@Autowired
	FoundMessageMapper foundMessageMapper;
	@Autowired
	FoundMatchToLost foundMatchToLost;
	
	public static int post = 1;
	
	//@Scheduled(fixedDelay = 15*1_000)
	public void run() {
		String photoBasic = "E:\\photo\\";
		FMatchLId fMatchLId = FMatchLId.getInstance();
		System.out.println("FMatchL上一次任务执行后当前id及最大id分别是"+fMatchLId.getCurrentId()+" "+fMatchLId.getMaxId());
		int id = foundMessageMapper.selectLastId();
		System.out.println("查询到id是"+id);
		int tmp = fMatchLId.getMaxId();
		fMatchLId.setCurrentId(tmp);
		if(id>tmp){
			fMatchLId.setMaxId(id);
			foundMatchToLost.setTar(fMatchLId, photoBasic);
			foundMatchToLost.run();
		}
	}
}
